import './HomeA01.scss'
import { Button } from 'antd'
import { useNavigate } from 'react-router-dom'

const HomeA01 = ({ router }) => {
    const onNavigate = useNavigate()

    return (
        <div className='HomeA01'>
            {router.map(({ key, title, children }) =>
                <div key={key}>
                    <Button onClick={() => {
                        if (children) onNavigate(`/Start/${children[0].key}`)
                        else onNavigate(`/Start/${key}`)
                    }}>{title}</Button>
                </div>
            )}
        </div>
    )
}

export default HomeA01